package com.mapbased.util;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy_hs(Baily)
 * @version 1.0
 */
public class IntegerDate
{
    public IntegerDate()
    {
        super();
    }

    /**
     * 10 second
     * @param date int
     * @return long
     */
    public static long toLong(int date)
    {
        return((long)date) * 10000;
    }

    /**
     * ten second
     * @param date long
     * @return int
     */
    public static int toInt(long date)
    {
        return(int)(date / 10000l);

    }

    public static String toStrNumber(long date)
    {
        int i=toInt(date);
        return com.mapbased.util.StringNumber.toString(i);
    }

    public static String toStrNumberFixLength(long date)
    {
        int i=toInt(date);
        return com.mapbased.util.StringNumber.toStringFixLength(i);

    }

    public static long fromStrNumber(String s)
    {
        int i=com.mapbased.util.StringNumber.parseInt(s);
        return toLong(i);
    }

    public static void main(String[] args)
    {
        //System.out.println();

//        System.out.println(new java.util.Date(0l).toGMTString());
//        System.out.println(System.currentTimeMillis());
//
//        System.out.println(System.currentTimeMillis()/1000/60);
//while(true)
//      {
//        try
//        {
//            Thread.currentThread().sleep(1000);
//        }
//        catch(InterruptedException ex)
//        {ex.printStackTrace();
//        }
//        long l=System.currentTimeMillis();
//        System.out.println(
//            l+"========"+toLong(toInt(l))
//
//            );
//          System.out.println(new java.util.Date(
//              (toLong(toInt(System.currentTimeMillis())))).toGMTString());
//      }

    }
}
